﻿@{
    ViewBag.Title = "AdvManage";
    Layout = null;
}
@model List<UcAsp.Net.Model.AdvPositions>
<script type="text/javascript">
    tinymce.init({
        selector: "textarea",
        plugins: [
        "advlist autolink lists link image charmap print preview anchor",
        "searchreplace visualblocks code fullscreen",
        "insertdatetime media table contextmenu paste hr upfile"
    ],
        toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent |link image upfile"

    });
    $(function () {
        $(".saveadv").click(function () {
            var adv = $(this).attr("data-id");
            var cid = $(this).attr("data-cid");
            $.post("/admin/SaveAdv", { AdvHtml: tinyMCE.get(adv).getContent(), AdvChinaName: adv, AdvPositionName: adv,CId:cid @if(Request["Message"]!=null){<text>,Message:'show'</text>}}, function () { 
            alert("保存完毕")
            })
        })
    })

</script>
<div class="widget-box">
    <div class="widget-title">
        <span class="icon"><i class="icon-align-justify"></i></span>
        <h5>
            广告位管理</h5>
    </div>
    <div class="widget-content nopadding">
        <form action="#" method="get" class="form-horizontal">
        <div class="row-fluid">
        @foreach (UcAsp.Net.Model.AdvPositions adv in Model)
        {
            <div class="span9">
                <div class="control-group">
                    <label class="control-label">
                        @adv.AdvPositionName</label>
                    <div class="controls">
                        <textarea class="text-input textarea wysiwyg"  name="@adv.AdvPositionName" cols="79" rows="5">@adv.AdvHtml</textarea>
                    </div>
                </div>
            </div>
            <div class="span2">
                <div class="btn saveadv" data-cid="@ViewData["Id"]" data-id="@adv.AdvPositionName">保存</div>
            </div>
        }
        </div>
        </form>
    </div>
</div>
